from datetime import datetime

from pydantic import BaseModel, Field
from schemas import GMT


class MailIn(BaseModel):
    receiver_mail: str = Field(example="收件人邮箱")
    name: str = Field(example="收件人名称")
    description: str = Field(example="描述")
    create_name: str = Field(example="创建者")
    update_name: str = Field(example="最后更新人")
    status: bool = Field(example=True)
    project_id: int = Field(example="项目ID")


class MailCreate(MailIn):
    pass


class MailUpdate(MailIn):
    pass


class MailOut(MailIn, GMT):
    id: int = Field(example="编号")

    class Config:
        orm_mode = True
